
	var lk_body_bg1=null;//body背景图片
	var lk_body_bg2=null;//将要改成的背景图片
	$(function(){
		lk_body_bg1=$(".yhj_content").attr("style");//获取初始背景
		//alert(lk_body_bg1);
		var lk_select_bgDivtop=document.body.clientHeight-340;//设置背景块距离顶部的高度
		$("#lk_select_bgDiv").css({top: $(window).outerHeight(),display:"none" });//设置位置
		$(".lk_select_bgDiv_top li").each(function(index, element) {
            $(this).val(index);//为了区分是点了哪一个li
        });
		$(".lk_select_bgDiv_top li").bind("click",function(){//导航栏
			$(".lk_select_bgDiv_top li").css("background","none");
			$(this).css("background","#000");
			$(".lk_select_bgDiv_down_smallBg").css("display","none").eq($(this).val()).css("display","block");
		});
		$("#lk_select_buttom").bind("click",function(){//弹出按钮		
			$("#lk_select_bgDiv").css("display","block").animate({top:lk_select_bgDivtop+"px"});
		});
		$(".lk_select_bgDiv_del,#lk_select_bgDiv_down_buttom_2,#lk_select_bgDiv_down_buttom_1").bind("click",function(){//隐藏
			$("#lk_select_bgDiv").animate({top:$(window).outerHeight()+"px"});
			$("#lk_select_bgDiv").css("display","block");
		});
		$(".lk_select_bgDiv_down_smallBg_img").bind({//小图片事件
			mouseover:function(){
				$(".lk_select_bgDiv_down_smallBg_img").css("border","2px solid #FFC");
				$(this).css("border","2px solid #F93");
			},
			click:function(){
				lk_body_bg2=$(this).children("img").attr("src");//图片路径
				$(".yhj_content").attr("style","background:url("+lk_body_bg2+") no-repeat;background-size:cover");//预览
				$(".yhj_content_maincontent_right_userinfo_head").css({"background":"url("+lk_body_bg2+") no-repeat #1C0E00","background-size":"cover"});
			}
		});
		$(".lk_select_bgDiv_down_smallBg").css("display","none").eq(0).css("display","block");//默认经典选择背景
		$("#lk_select_bgDiv_down_buttom_1").bind("click",function(){//确定按钮
			lk_body_bg1="background:url("+lk_body_bg2+") no-repeat;background-size:contain";//拼接背景格式
			$(".yhj_content_maincontent_right_userinfo_head").css({"background":"url("+lk_body_bg2+") no-repeat #1C0E00","background-size":"cover"});
			//背景要配合背景颜色，如果用户登录了，就从数据库中读出用户信息到session中，如果没有登录，需要从背景表中，读出图片路径并配合背景颜色
		});
		$("#lk_select_bgDiv_down_buttom_2,.lk_select_bgDiv_del").bind("click",function(){//取消按钮
			$(".yhj_content").attr("style",lk_body_bg1);
			$(".yhj_content_maincontent_right_userinfo_head").attr("style",lk_body_bg1);
			$(".yhj_content_maincontent_right_userinfo_head").css("height","");
			$(".yhj_content_maincontent_right_userinfo_head").css("background-size","cover");
		});
	});